<template>
	<uni-nav-bar class="theme-navBar" v-bind="$attrs" :fixed="true" shadow :border="false" status-bar :left-icon="props.leftIcon"
		:leftText="props.leftText" :color="props.color" :backgroundColor="props.backgroundColor" :title="props.title"
		@clickLeft="clickLeft" @clickRight="clickRight">
	</uni-nav-bar>
</template>

<script setup>
const emits = defineEmits(['clickLeft', 'clickRight']);
const props = defineProps({
	leftText: {
		type: String,
		//返回
		default: () => ''
	},
	leftIcon: {
		type: String,
		//left
		default: () => ''
	},
	rightText: {
		type: String,
		default: () => ''
	},
	title: {
		type: String,
		required: true
	},
	backgroundColor: {
		type: String,
		default: () => '#FFFFFF'
	},
	color: {
		type: String,
		default: () => '#444444'
	}
});
function clickLeft() {
	if (!props.leftText && !props.leftIcon) return;
	uni.navigateBack();
	emits('clickLeft');
}

function clickRight() {
	emits('clickRight');
}
</script>
<style lang="less">
@import 'index';
</style>
